package com.app.couponsharelife

import org.junit.Test

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {

    private var randomIndexList = mutableListOf<Int>()

    @Test
    fun addition_isCorrect() {
        containsNumbers("hello 1 2 3 world 4 5 6")
    }

    private fun containsNumbers(string: String): Boolean {
        val numbersInString = string.filter { ("0".."9").contains(it.toString()) }
        println(numbersInString)
        return numbersInString.isNotEmpty()
    }

    private fun calculateRandomIndex(size: Int) {
        randomIndexList.clear()
        for (i in 1 until size) {
            randomIndexList.add(i)
        }
        randomIndexList.shuffle()
        randomIndexList.map {
            println(it)
        }
    }
}
